
<template>
  <div class="nickname">
    <top-tab @saveClick="savefn"></top-tab>
    <input type="text" v-model="nickname" />
  </div>
</template>

<script>
import topTab from "@/components/toptab.vue";
import { getuserInfo } from "@/request/longin";
import { setuser } from "@/request/info";
export default {
  name: "",
  components: { topTab },
  data() {
    return {
      nickname: "",
    };
  },
  created() {
    // console.log(this.$route.query.nickname);
    this.nickname = this.$route.query.nickname.toString();
  },
  mounted() {},
  methods: {
    async savefn() {
      let res = await setuser(this.nickname);
      console.log(res);
      // this.$router.back();
      console.log(this.nickname);
      // this.getuserInfo();
    },
    // async getuserInfo() {
    //   let res = await getuserInfo();
    //   console.log(res);
    //   this.infoList = res.data.data;
    // },
  },
};
</script>
<style scoped lang='scss'>
input {
  width: 100%;
  height: 50px;
  border: none;
  padding-left: 20px;
  box-sizing: border-box;
}
</style>
